{% extends 'home/home.html' %}
{% block index %}
{% load static %}

<div class="uk-section uk-section-small uk-text-center">
    <div class="uk-width-1-1">
        <div class="uk-container" style="max-width: 500px;">
            <p>
                <img src="{{ myuser.avatar }}" style="max-width: 200px; border-radius: 10%;"/>
            </p>
            <p class="uk-text-lead">{{ username }}</p>
            <form method="post" action="/useradmin">
                {% csrf_token %}
                <table class="uk-table uk-table-striped uk-table-hover uk-table-small" frame="void">
                    <tbody>
                        <tr>
                            <td style="font-weight:bold;vertical-align: middle!important;">姓</td>
                            <td class="uk-text-right">
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon uk-icon" uk-icon="icon: user"></span>
                                    <input class="uk-input" type="text" name="last_name" placeholder="姓"
                                        value="{{ myuser.user.last_name }}">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;vertical-align: middle!important;">名</td>
                            <td class="uk-text-right">
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon uk-icon" uk-icon="icon: user"></span>
                                    <input class="uk-input" type="text" name="first_name" placeholder="名"
                                        value="{{ myuser.user.first_name }}">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;vertical-align: middle!important;">年龄</td>
                            <td class="uk-text-right">
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon uk-icon" uk-icon="icon: heart"></span>
                                    <input class="uk-input" type="text" name="age" placeholder="年龄"
                                        value="{{ myuser.age }}">
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <!-- 不可以格式化 -->
                            <!-- 不可以格式化 -->
                            <!-- 不可以格式化 -->
                            <td style="font-weight:bold;vertical-align: middle!important;">性别</td>
                            <td class="uk-text-center">
                                <div class="uk-inline uk-width-1-1">
                                    <label><input class="uk-radio" type="radio" value="male" name="gender" 
                                        {% if myuser.gender == "male" %} 
                                            checked 
                                        {% endif %}>男</label>
                                    <label><input class="uk-radio" type="radio" value="female" name="gender" 
                                        {% if myuser.gender == "female" %}
                                            checked 
                                        {% endif %}>女</label>
                                    <label><input class="uk-radio" type="radio" value="null" name="gender" 
                                        {% if myuser.gender == "null" %}
                                            checked 
                                        {% endif %}>保密</label>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td style="font-weight:bold;vertical-align: middle!important;">头像地址</td>
                            <td class="uk-text-right">
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon uk-icon" uk-icon="icon: image"></span>
                                    <input class="uk-input" type="text" name="avatar" placeholder="头像地址"
                                        value="{{ myuser.avatar }}">
                                </div>
                            </td>
                        </tr>                            
                        <tr>
                            <td style="font-weight:bold;vertical-align: middle!important;">个性简介(允许html)</td>
                            <td class="uk-text-right">
                                <div class="uk-inline uk-width-1-1">
                                    <textarea class="uk-textarea" rows="5" name="signature" placeholder="个性简介" >{{ myuser.signature }}</textarea >
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <button class="uk-button uk-button-primary uk-width-1-1">更新资料</button>
                <p class="uk-margin-medium-top	"><a href="/">{{ welcoming }}</a> © 2023-2028</p>
            </form>
        </div>
    </div>

</div>
{% endblock %}